// store/drawer.js
import { defineStore } from 'pinia'

export const useDrawerStore = defineStore('drawer', {
  state: () => ({
    isVisible: false,
    showAddWarehouse: false // 是否显示添加协同仓功能
  }),
  actions: {
    toggleDrawer(showAdd = false) {
      this.isVisible = !this.isVisible
      this.showAddWarehouse = showAdd
    },
    openDrawer(showAdd = false) {
      this.isVisible = true
      this.showAddWarehouse = showAdd
    },
    closeDrawer() {
      this.isVisible = false
      this.showAddWarehouse = false
    }
  }
})